{extend name="../admin/common/base" /}

{block name="body"}

<div style="padding: 0px 10px 0px 10px">
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li ><a href="{:url('mp/Material/index',['type'=>'image','from_type'=>0])}">本地素材</a></li>
            <li ><a href="{:url('mp/Material/index',['type'=>'image','from_type'=>1])}"> 微信服务器</a></li>
            <li class="layui-this"><a href="{:url('mp/Material/sendRecord')}"> 群发记录</a></li>
        </ul>
    </div>


</div>
<div style="padding: 0px 10px 0px 10px;">
    <table class="layui-table">
        <colgroup>
            <col width="120">
            <col width="200">
            <col>
            <col width="80">
            <col width="150">
            <col width="80">
        </colgroup>
        <thead>
        <tr>
            <th>封面</th>
            <th>标题</th>
            <th>摘要</th>
            <th>类型</th>
            <th>发送时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="data" id="v" }
        <tr>
            <td><a href="{$v.url}" target="_blank" ><img src="{$v.url}" alt="" width="100" height="60" ></a></td>
            <td>{$v.title}</td>
            <td>{$v.description}</td>
            <td>{$v.type_name}</td>
            <td>{$v.create_time}</td>
            <td>  <a class="rha-bt-a" onclick="deleteRole('{$v.id}')" href="javascript:;">删除</a></td>
        </tr>
        {/volist}
        </tbody>
    </table>
    {$page|raw}

</div>

<script>

    function deleteRole(id) {
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.confirm('你确定需要删除吗？', {
                btn: ['是','不'] //按钮
            }, function(){
                $.post("{:url('deleteRecord')}",{'id':id},function (res) {
                    layer.msg('删除成功',{time:1000},function () {
                        window.location.reload();
                    });
                })
            })
        });

    }

</script>
{/block}